//
//  TButton.m
//  tour
//
//  Created by lyuan on 15/5/11.
//  Copyright (c) 2015年 Jushi. All rights reserved.
//

#import "TButton.h"

@implementation TButton

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGSize size = self.frame.size;
    
    if (self.type == ButtonType_TB) {
        self.imageView.frame = CGRectMake((size.width-self.imageView.frame.size.width)/2,
                                          size.height/2-self.imageView.frame.size.height,
                                          self.imageView.frame.size.width,
                                          self.imageView.frame.size.height);
        self.titleLabel.frame = CGRectMake(0,
                                           size.height/2+(size.height/2-self.titleLabel.frame.size.height)/2,
                                           size.width,
                                           self.titleLabel.frame.size.height);
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
